package agriculture.service;

import agriculture.bean.Order;
import agriculture.dto.OrderRequest;
import agriculture.dto.UpdateReceiverRequest;
import agriculture.system.api.model.OrderPaidMessage;

import java.time.LocalDateTime;
import java.util.List;

public interface OrderService {

    //添加订单
    Order createOrder(OrderRequest orderRequest);

    //根据用户Id获取该用户的所有订单信息
    List<Order> selectOrderAllByUserId(Long userId);

    //更新订单的状态
    void updateOrderStatus(String orderNumber, String status, LocalDateTime payTime);
    //增加订单详情
    void insertOrderDetails(String orderNumber,int quantity,String paymentMethod);

    //更新订单里面的收货人信息
    boolean updateOrderInfo(String orderNumber, UpdateReceiverRequest updateReceiverRequest);

    //根据订单的ID去获取对应的订单详细信息
    Order getOrderDetailByOrderNumber(String orderNumber);

    //根据订单ID去获取订单里面的商品ID
    Long getProductIdByOrderNumber(String orderNumber);

    //处理订单事务
    void handleOrderPaid(OrderPaidMessage message);
}

